package presentation;

import java.awt.BorderLayout;
import java.awt.Color;

import javax.swing.Box;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;

import controle.CSabot;
import controle.CSolitaire;

public class PSolitaire extends JFrame {
	
	private CSolitaire solitaire;

	public PSolitaire(CSolitaire solitaire)
	{
	this.solitaire=solitaire;
	
	}
	
	public void initialiser(){

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 816, 378);
		getContentPane().setLayout(new BorderLayout());

		JPanel sabot = solitaire.getSabot().getPresentation();
		sabot.setBorder(new LineBorder(new Color(0, 0, 0)));
		sabot.setBackground(new Color(47, 79, 79));


		JPanel PTDC = new QuatreTasDeCartesColorees(solitaire);
		PTDC.setBorder(new LineBorder(new Color(0, 0, 0)));
		PTDC.setBackground(new Color(47, 79, 79));
		
		
		
		JPanel conteneurColonne = new JPanel();
		//Colonne.setBounds(0, 330, 800, 10);
		conteneurColonne.setBackground(new Color(46, 139, 87));
		getContentPane().setLayout(new BorderLayout());
		
		JPanel colonne1 = solitaire.getColonne(1).getPresentation();
		JPanel colonne2 = solitaire.getColonne(2).getPresentation();
		JPanel colonne3 = solitaire.getColonne(3).getPresentation();
		JPanel colonne4 = solitaire.getColonne(4).getPresentation();
		JPanel colonne5 = solitaire.getColonne(5).getPresentation();
		JPanel colonne6 = solitaire.getColonne(6).getPresentation();
		JPanel colonne7 = solitaire.getColonne(7).getPresentation();
		
		Box box2 = Box.createHorizontalBox();
		box2.add(colonne1);
		box2.add(colonne2);
		box2.add(colonne3);
		box2.add(colonne4);
		box2.add(colonne5);
		box2.add(colonne6);
		box2.add(colonne7);
		
		conteneurColonne.add(box2);
				
		JPanel lesColonnes = new JPanel();
		lesColonnes.setLayout(new BorderLayout());
		lesColonnes.setBackground(Color.blue);
		lesColonnes.setBounds(0, 0, 816, 400);
		lesColonnes.add(sabot, BorderLayout.CENTER);
		lesColonnes.add(PTDC, BorderLayout.WEST);
		
		
		getContentPane().add(lesColonnes, BorderLayout.NORTH);
		getContentPane().add(conteneurColonne, BorderLayout.CENTER);
		
		this.setVisible(true);
	}

}
